package com.mdtx.controller;

import com.mdtx.entity.ClassAttribute;
import com.mdtx.entity.FieldAttribute;
import com.mdtx.write.GenerateCode;
import freemarker.template.TemplateException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * @author zhgz
 * @create 2017-07-29 16:00
 **/
@RestController
@RequestMapping("/a")
public class TestController {
    @Autowired
    GenerateCode t;

    @RequestMapping("/aa")
    public String aa(){
        Map<String, Object> root = new HashMap<String, Object>();



        root.put("classAttribute",null);
        root.put("fieldAttributeList",null);

        try {
            t.generate(root,"model.ftl","D:\\Person.java");
        } catch (TemplateException e) {
            e.printStackTrace();
        }
        return "1";
    }
}
